<!DOCTYPE html>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css">
<title>Captive</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>


<script>

	var init = 5;
	
	$(document).ready(
		function() {
			document.getElementById("dialog").style.display="inherit";
			document.getElementById("background").style.display="inherit";
			document.getElementById("peopleimage").src="images/stephen.png";
			document.getElementById("dialog").innerHTML = "Stephen says: <br/>Enough! I don't have time for this!";
			$("#dialog").click(dialog0);
		}
	);
	
	function dialog0()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "(Stephen points the gun at me.)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog1);
		}
	}
	
	function dialog1()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy says: <br/>Please, Stephen!! Don't shoot!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2);
		}
	}
	
	function dialog2()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/stephen.png";
		document.getElementById("dialog").innerHTML = "Stephen shouts: <br/>I HATE HIM! I would never sleep soundly if I don't shoot him right now!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_1);
		}
	}
	
	function dialog2_1()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy says: <br/>NOOOOOOO!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog3);
		}
	}
	
	function dialog3()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById('audiotag2').play();
		document.getElementById("dialog").style.display="none";
		setTimeout(bind_click, 3000);
		function bind_click(){
			dialog4();
		}
	}
	
	
	
	function dialog4()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").style.display="inherit";
		document.getElementById("dialog").innerHTML = "(I see Jimmy collapsing to the floor. He took the bullet for me.)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog5);
		}
	}
	
	function dialog5()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "I say: <br/>JIMMY!!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog6);
		}
	}
	
	function dialog6()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/stephen.png";
		document.getElementById("dialog").innerHTML = "Stephen says: <br/>No...No...Jimmy...What have I done....";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog7);
		}
	}
	
	function dialog7()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "(Someone pounds on the door)";
		document.getElementById('audiotag1').play();
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog8);
		}
	}
	
	function dialog8()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/police.png";
		document.getElementById("dialog").innerHTML = "Policeman shouts through the door: <br/>This is police! Drop your weapon and open the door!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog9);
		}
	}
	
	function dialog9()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "I say: <br/>Help!! My son has been shot!! The man has a gun!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog10);
		}
	}
	
	function dialog10()
	{
		$("#dialog").unbind('click');
		document.getElementById('audiotag2').play();
		document.getElementById("dialog").innerHTML = "(The policeman breaks through the door. Stephen points his gun at the policeman. But the policeman is quicker. He shoots Stephen in the chest.)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog13);
		}
	}
	
	function dialog13()
	{
		$("#dialog").unbind('click');
		$("#dialog").fadeOut(5000,nextscene);
	}

	function nextscene()
	{
		window.location = "end8.php";
	}
	
</script>



</head>

<body>


<div id="container">
	<div id="background"><img src="images/basement.jpg" /></div>
	<div id="dialog">
	</div>
	<div id="people"><img id="peopleimage" src=""></div>
</div>
<audio id="audiotag1" src="audios/pound.mp3" preload="auto"></audio>
<audio id="audiotag2" src="audios/gunshot.mp3" preload="auto"></audio>



</body>
</html>